package com.wcity.manage.web.Announcement;

import com.wcity.manage.dao.dal.model.PageModel;
import com.wcity.manage.dao.model.Block;
import com.wcity.manage.service.announcement.AnnSendBlockService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * 查看已发送公告的小区
 * Created by zm on 2016/12/16.
 */
@Controller
public class AnnSendBlockAct {

    @Resource private AnnSendBlockService annSendBlockService;

    /**
     * 查看已发送的小区名称
     * @param request
     * @return
     */
    @RequestMapping ("ann_send_block")
    public String sendBlock (Block block, PageModel pageModel, HttpServletRequest request,int id ) {
        try {
            block.setId(id);
            pageModel.setParams(block);
            request.setAttribute( "block", block);
            request.setAttribute( "list", annSendBlockService.sendBlock ( pageModel ));
        }catch (Exception e){
            e.printStackTrace();
        }
        return "announcement/annSendBName";
    }
}
